package com.woniuxy.common.entity;



import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

//聊天消息类

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("chat_message")
public class ChatMessage {
    @TableId(type = IdType.AUTO)
    private Long id;//消息id

    private String senderId;//发送消息人的id

    private String receiverId;//接收消息人的id

    private String content;//消息内容

    private LocalDateTime timestamp = LocalDateTime.now();

    private MessageStatus status = MessageStatus.SENT; // 消息状态
    private MessageType messageType = MessageType.TEXT; // 消息类型

    private boolean isDelivered = false; // 是否已送达

    // 枚举消息状态
    public enum MessageStatus {
        SENT,        // 已发送
        DELIVERED,   // 已送达
        READ         // 已读
    }
    // 枚举消息类型
    public enum MessageType {
        TEXT, IMAGE, VOICE, FILE
    }


}
